home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / precog2_1.lha / Precognition2_1 / src / src.lha / Library / Positioner.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  1.7 KB  |  85 lines

  1.  
  2. #include "parms.h" /* added for proper prototyping -- EDB */
  3. #include "Valuator.h"
  4. #include "ValuatorClass.h"
  5.  
  6. #include "Positioner.h"
  7. #include "PositionerClass.h"
  8. #ifndef __GNUC__
  9. #include <clib/exec_protos.h>
  10. #include <clib/intuition_protos.h>
  11. #include <clib/graphics_protos.h>
  12. #endif
  13. #ifdef __GNUC__
  14. #include <proto/exec.h>
  15. #include <proto/intuition.h>
  16. #include <proto/graphics.h>
  17. #endif
  18. #ifdef __SASC
  19. #include <proto/exec.h>
  20. #include <proto/intuition.h>
  21. #include <proto/graphics.h>
  22. #endif
  23. #include "amigamem.h"
  24.  
  25. USHORT KnobSize( Positioner *self )
  26. {
  27.    struct PositionerClass *class;
  28.  
  29.  
  30.    if( class = (struct PositionerClass *)self->isa )
  31.    {
  32.       if( class->KnobSize )
  33.          return (*class->KnobSize)( self );
  34.    }
  35.    else
  36.       return 0;
  37. }
  38.  
  39.  
  40. USHORT SetKnobSize( Positioner *self, USHORT knobsize )
  41. {
  42.    struct PositionerClass *class;
  43.  
  44.  
  45.    if( class = (struct PositionerClass *)self->isa )
  46.    {
  47.       if( class->SetKnobSize )
  48.          return (*class->SetKnobSize)( self, knobsize );
  49.    }
  50.    else
  51.       return 0;
  52. }
  53.  
  54. BOOL Positioner_elaborated = FALSE;
  55.  
  56. struct PositionerClass Positioner_Class;
  57.  
  58. void PositionerClass_Init( struct PositionerClass *class )
  59. {
  60.    ValuatorClass_Init( (struct ValuatorClass *)class );
  61.    class->isa           = ValuatorClass();
  62.    class->ClassName     = "Positioner";
  63.    class->Value         = NULL;
  64.    class->SetValue      = NULL;
  65.    class->KnobSize      = NULL;
  66.    class->SetKnobSize   = NULL;
  67. }
  68.  
  69.  
  70. struct PositionerClass *PositionerClass( void )
  71. {
  72.    if( ! Positioner_elaborated )
  73.    {
  74.       PositionerClass_Init( &Positioner_Class );
  75.       Positioner_elaborated = TRUE;
  76.    }
  77.  
  78.    return &Positioner_Class;
  79. }
  80.  
  81.  
  82. void Positioner_Init( Positioner *self )
  83. {
  84.    Valuator_Init( (Valuator *)self );
  85. }